package lab02.test11;

public class Square extends  Rectangle{

    private double  diagonal;

    public void setDiagonal(double diagonal) {
        this.diagonal = diagonal;
    }

    public double getDigonal(){

       diagonal=Math.sqrt(grow*grow+wide*wide);
       return diagonal;
   }

    @Override
    public void printMyWay() {

        //super.getPerimeter();
        //super.getArea();
        super.printMyWay();
        System.out.println("对角线长："+getDigonal());
    }
}
